3.3.44 \(\int \frac {\log (x)}{1+x^2} \, dx\) [244]

Optimal. Leaf size=32 \[ \tan ^{-1}(x) \log (x)-\frac {1}{2} i \text {Li}_2(-i x)+\frac {1}{2} i \text {Li}_2(i x) \]

[Out]

arctan(x)*ln(x)-1/2*I*polylog(2,-I*x)+1/2*I*polylog(2,I*x)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {209, 2361, 4940, 2438} \begin {gather*} -\frac {1}{2} i \text {PolyLog}(2,-i x)+\frac {1}{2} i \text {PolyLog}(2,i x)+\text {ArcTan}(x) \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Log[x]/(1 + x^2),x]

[Out]

ArcTan[x]*Log[x] - (I/2)*PolyLog[2, (-I)*x] + (I/2)*PolyLog[2, I*x]

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 2361

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/((d_) + (e_.)*(x_)^2), x_Symbol] :> With[{u = IntHide[1/(d + e*x^2),
 x]}, Simp[u*(a + b*Log[c*x^n]), x] - Dist[b*n, Int[u/x, x], x]] /; FreeQ[{a, b, c, d, e, n}, x]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 4940

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))/(x_), x_Symbol] :> Simp[a*Log[x], x] + (Dist[I*(b/2), Int[Log[1 - I*c*x
]/x, x], x] - Dist[I*(b/2), Int[Log[1 + I*c*x]/x, x], x]) /; FreeQ[{a, b, c}, x]

Rubi steps

\begin {align*} \int \frac {\log (x)}{1+x^2} \, dx &=\tan ^{-1}(x) \log (x)-\int \frac {\tan ^{-1}(x)}{x} \, dx\\ &=\tan ^{-1}(x) \log (x)-\frac {1}{2} i \int \frac {\log (1-i x)}{x} \, dx+\frac {1}{2} i \int \frac {\log (1+i x)}{x} \, dx\\ &=\tan ^{-1}(x) \log (x)-\frac {1}{2} i \text {Li}_2(-i x)+\frac {1}{2} i \text {Li}_2(i x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(65\) vs. \(2(32)=64\).
time = 0.01, size = 65, normalized size = 2.03 \begin {gather*} -\frac {1}{2} i \log (-i (i-x)) \log (x)+\frac {1}{2} i \log (x) \log (-i (i+x))-\frac {1}{2} i \text {Li}_2(-i x)+\frac {1}{2} i \text {Li}_2(i x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Log[x]/(1 + x^2),x]

[Out]

(-1/2*I)*Log[(-I)*(I - x)]*Log[x] + (I/2)*Log[x]*Log[(-I)*(I + x)] - (I/2)*PolyLog[2, (-I)*x] + (I/2)*PolyLog[
2, I*x]

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 46, normalized size = 1.44

method result size
meijerg \(\left (\frac {\ln \left (x \right ) \Phi \left (-x^{2}, 1, \frac {1}{2}\right )}{2}-\frac {\Phi \left (-x^{2}, 2, \frac {1}{2}\right )}{4}\right ) x\) \(26\)
default \(-\frac {i \ln \left (x \right ) \ln \left (i x +1\right )}{2}+\frac {i \ln \left (x \right ) \ln \left (-i x +1\right )}{2}-\frac {i \dilog \left (i x +1\right )}{2}+\frac {i \dilog \left (-i x +1\right )}{2}\) \(46\)
risch \(-\frac {i \ln \left (x \right ) \ln \left (i x +1\right )}{2}+\frac {i \ln \left (x \right ) \ln \left (-i x +1\right )}{2}-\frac {i \dilog \left (i x +1\right )}{2}+\frac {i \dilog \left (-i x +1\right )}{2}\) \(46\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(x)/(x^2+1),x,method=_RETURNVERBOSE)

[Out]

-1/2*I*ln(x)*ln(1+I*x)+1/2*I*ln(x)*ln(1-I*x)-1/2*I*dilog(1+I*x)+1/2*I*dilog(1-I*x)

________________________________________________________________________________________

Maxima [A]
time = 0.52, size = 26, normalized size = 0.81 \begin {gather*} \frac {1}{4} \, \pi \log \left (x^{2} + 1\right ) + \frac {1}{2} i \, {\rm Li}_2\left (i \, x + 1\right ) - \frac {1}{2} i \, {\rm Li}_2\left (-i \, x + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(x)/(x^2+1),x, algorithm="maxima")

[Out]

1/4*pi*log(x^2 + 1) + 1/2*I*dilog(I*x + 1) - 1/2*I*dilog(-I*x + 1)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(x)/(x^2+1),x, algorithm="fricas")

[Out]

integral(log(x)/(x^2 + 1), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\log {\left (x \right )}}{x^{2} + 1}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(x)/(x**2+1),x)

[Out]

Integral(log(x)/(x**2 + 1), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(x)/(x^2+1),x, algorithm="giac")

[Out]

integrate(log(x)/(x^2 + 1), x)

________________________________________________________________________________________

Mupad [B]
time = 3.33, size = 24, normalized size = 0.75 \begin {gather*} \mathrm {atan}\left (x\right )\,\ln \left (x\right )-\frac {\mathrm {polylog}\left (2,-x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2}+\frac {\mathrm {polylog}\left (2,x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(log(x)/(x^2 + 1),x)

[Out]

atan(x)*log(x) - (polylog(2, -x*1i)*1i)/2 + (polylog(2, x*1i)*1i)/2

________________________________________________________________________________________